package vip.specimen.system.datasource.validation;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Set;
import java.util.UUID;

/**
 * *@Author: 余浪人
 * *@Date：2021/3/10 17:09
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
public class SystemResourceKindValidation {
    @NotBlank(message = "分类名称不可为空")
    @Size(max = 200, message = "分类名称过长")
    @ApiModelProperty(value = "分类名称", dataType = "String")
    private String name;
    @Size(max = 1024, message = "分类简介过长")
    @ApiModelProperty(value = "分类简介")
    private String intro;
    @Valid
    @Size(min = 1, message = "请选择文件类型")
    @ApiModelProperty(value = "分类文件类型", dataType = "List")
    private Set<UUID> suffix;
    @NotBlank(message = "请填写存储路径")
    @Pattern(regexp = "^/.*", message = "存储路径需以“/”开始")
    @Pattern(regexp = "^/[a-zA-Z]+[a-zA-Z|0-9]$", message = "存储路径需以字母或数字结尾")
    @ApiModelProperty(value = "分类存储路径")
    private String path;
}
